package com.jr.controller;

import com.jr.pojo.FlightsProjrct;
import com.jr.service.AirService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.ArrayList;

@Controller
@RequestMapping("/air")
public class controller {

    @Autowired
    private AirService airService;


    @RequestMapping("/index")
    public String showAll(Model model){
        ArrayList<FlightsProjrct> list = airService.showAll();
        model.addAttribute("list",list);
        return "index.html";
    }

}
